Skip to content

Add security setting to more strictly enforce audience validation#622

Merged
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
nholden:strict-audience-validation
Oct 14, 2021
Merged

Add security setting to more strictly enforce audience validation#622
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
nholden:strict-audience-validation

Conversation

@nholden
Copy link
Copy Markdown
Contributor

@nholden nholden commented Oct 12, 2021

Status

READY

Migrations

NO

Description

Per the SAML 2.0 Core specification, Section 2.5.1.4, a service provider should expect SAML responses to include an <AudienceRestriction> element containing an <Audience> element with a URI reference that uniquely identifies the service provider.

Ruby SAML contains logic to validate that responses contain an <Audience> element matching settings.sp_entity_id. However, if the <AudienceRestriction> contains only empty <Audience> elements, Ruby SAML skips that validation per #444. It seems incorrect that we'd consider a response with a non-empty <Audience> element not matching settings.sp_entity_id to be invalid, but we'd consider a response with an empty <Audience> element (which also wouldn't match settings.sp_entity_id) to be valid.

This PR adds a new security option that will consider SAML responses containing only empty <Audience> elements to be invalid. By default, this option is not enabled, so it should not be a breaking change.

@pitbulk pitbulk merged commit 74c2545 into SAML-Toolkits:master Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants